/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package gui;

import java.io.*;
//import java.util.*;

/**
 *
 * @author hrushi
 */
public class ChatMessage implements Serializable {

    public char[] srcIP;
    public char[] srcName;
    public char[] destIP;
    public char[] destName;
    public int type;
    public int seq;
    public int payloadLength;
    public byte[] payload;

    public ChatMessage(char[] src_ip, char[] src_name, char[] dest_ip, char[] dest_name, int seq_num, int payload_length, String pay_load, int m_type) {
        srcIP = src_ip;
        srcName = src_name;
        destIP = dest_ip;
        destName = dest_name;
        seq = seq_num;
        type = m_type;
        payloadLength = payload_length;
        //payload = new byte[payload_length];
        payload = pay_load.getBytes();

//        System.out.println(String.valueOf(srcIP));
//        System.out.println(String.valueOf(srcName));
//        System.out.println(String.valueOf(destIP));
//        System.out.println(String.valueOf(destName));
//        System.out.println(seq);
//        System.out.println(payloadLength);
//        String temp = new String (payload, 0, payloadLength);
//        System.out.println(temp);
    }
}
